import service from "../index";
export const applyPersonHistory = (data) => {
//   return service({
//     method: "POST",
//     url: "/apt/approve/queryApprove",
//     data,
//   });

  return new Promise((res) => {
    res();
  });
};

export const allHTQD = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/vendorMap/queryContractDetail",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          num:'12341',
          description:'这是描述',
        },
        {
          num:'12341',
          description:'这是描述',

        },
      ],
    });
  });
};


export const allProjectCodeData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/queryEmpCode",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          value:'12341',

        },
        {
          value:'1222341',

        },
      ],
    });
  });
};


export const allWorkCodeData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/queryEmpCode",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          value:'12341',

        },
        {
          value:'1222341',

        },
      ],
    });
  });
};


export const DC = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/exportEmpTotalInfo",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};


export const submitPersonWH = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/updateEmp",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};

export const submitPersonTable = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/approve/createApprove",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};

// new
export const getAllPriject = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/tree/list",
    data,
  });
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          id: 31,
          label: "所有项目",
          type: "parent",
          children: [
            {
              label: "广西华谊项目",
              type: "children",
              address: "广西省钦州市钦南县大番坡",
              externalMan: 3,
              formalMan: 0,
              manager: "",
              onDuty: 3,
              position: [108.650212, 21.844304],
              projectCode: "19130",
              projectId: 299,
              projectName: "广西华谊项目",
              state: "进行中",
              totalInput: 3,
            },
            {
              label: "青海南玻",
              type: "children",
              address: "-",
              externalMan: 1,
              formalMan: 0,
              manager: "",
              onDuty: 1,
              position: [0.0, 0.0],
              projectCode: "-",
              projectId: 304,
              projectName: "青海南玻",
              state: "进行中",
              totalInput: 1,
            },
            {
              label: "万华PDH",
              type: "children",
              address: "-",
              externalMan: 1,
              formalMan: 0,
              manager: "",
              onDuty: 1,
              position: [0.0, 0.0],
              projectCode: "-",
              projectId: 314,
              projectName: "万华PDH",
              state: "进行中",
              totalInput: 1,
            },
            {
              label:
                "万华化学（福建）异氰酸酯有限公司40万吨/年MDI项目低温乙烯罐项目",
              type: "children",
              address: "福建省福清市江阴镇江阴港城经济区",
              externalMan: 2,
              formalMan: 0,
              manager: "",
              onDuty: 2,
              position: [119.320389, 25.455613],
              projectCode: "20205",
              projectId: 316,
              projectName:
                "万华化学（福建）异氰酸酯有限公司40万吨/年MDI项目低温乙烯罐项目",
              state: "进行中",
              totalInput: 2,
            },
            {
              label: "万华化学（四川）有限公司眉山NMP项目",
              type: "children",
              address: "四川省眉山高新技术产业园区",
              externalMan: 0,
              formalMan: 1,
              manager: "",
              onDuty: 1,
              position: [103.506829, 29.930827],
              projectCode: "21208",
              projectId: 317,
              projectName: "万华化学（四川）有限公司眉山NMP项目",
              state: "进行中",
              totalInput: 1,
            },
            {
              label: "新华半导体项目",
              type: "children",
              address: "-",
              externalMan: 2,
              formalMan: 0,
              manager: "",
              onDuty: 2,
              position: [0.0, 0.0],
              projectCode: "-",
              projectId: 318,
              projectName: "新华半导体项目",
              state: "进行中",
              totalInput: 2,
            },
            {
              label: "新疆宣东35万吨/年轻质煤焦油深加工项目（二期）EPC总承包",
              type: "children",
              address: "-",
              externalMan: 2,
              formalMan: 2,
              manager: "",
              onDuty: 4,
              position: [0.0, 0.0],
              projectCode: "21071",
              projectId: 319,
              projectName:
                "新疆宣东35万吨/年轻质煤焦油深加工项目（二期）EPC总承包",
              state: "进行中",
              totalInput: 4,
            },
            {
              label:
                "新疆中泰新材料股份有限公司资源化综合利用制甲醇升级示范项目净化装置",
              type: "children",
              address: "-",
              externalMan: 0,
              formalMan: 1,
              manager: "",
              onDuty: 1,
              position: [0.0, 0.0],
              projectCode: "22243",
              projectId: 320,
              projectName:
                "新疆中泰新材料股份有限公司资源化综合利用制甲醇升级示范项目净化装置",
              state: "进行中",
              totalInput: 1,
            },
            {
              label: "云南氟化氢",
              type: "children",
              address: "-",
              externalMan: 2,
              formalMan: 0,
              manager: "",
              onDuty: 2,
              position: [0.0, 0.0],
              projectCode: "22164",
              projectId: 322,
              projectName: "云南氟化氢",
              state: "进行中",
              totalInput: 2,
            },
            {
              label: "重庆气凝胶项目",
              type: "children",
              address: "-",
              externalMan: 2,
              formalMan: 1,
              manager: "",
              onDuty: 3,
              position: [0.0, 0.0],
              projectCode: "22040",
              projectId: 323,
              projectName: "重庆气凝胶项目",
              state: "进行中",
              totalInput: 3,
            },
          ],
        },
        {
          id: 32,
          label: "西北大区",
          type: "parent",
          children: [
            {
              label: "21811项目",
              type: "children",
              address: "-",
              externalMan: 0,
              formalMan: 1,
              manager: "",
              onDuty: 1,
              position: [0.0, 0.0],
              projectCode: "21811",
              projectId: 297,
              projectName: "21811项目",
              state: "进行中",
              totalInput: 1,
            },
            {
              label: "乐山协鑫新能源科技有限公司年产10万吨颗粒硅项目",
              type: "children",
              address: "-",
              externalMan: 2,
              formalMan: 2,
              manager: "",
              onDuty: 4,
              position: [0.0, 0.0],
              projectCode: "21060",
              projectId: 301,
              projectName: "乐山协鑫新能源科技有限公司年产10万吨颗粒硅项目",
              state: "进行中",
              totalInput: 4,
            },
            {
              label: "内蒙古三维新材料有限公司BDO一体化项目",
              type: "children",
              address: "内蒙古自治区乌海市经济技术开发区低碳产业园",
              externalMan: 1,
              formalMan: 4,
              manager: "",
              onDuty: 5,
              position: [106.794249, 39.655388],
              projectCode: "22007",
              projectId: 302,
              projectName: "内蒙古三维新材料有限公司BDO一体化项目",
              state: "进行中",
              totalInput: 5,
            },
            {
              label: "内蒙古鑫元硅材料科技有限公司年产10万吨颗粒硅项目",
              type: "children",
              address: "内蒙古包头钢铁开发区冶金",
              externalMan: 3,
              formalMan: 2,
              manager: "",
              onDuty: 5,
              position: [109.825569, 40.658303],
              projectCode: "21098",
              projectId: 303,
              projectName: "内蒙古鑫元硅材料科技有限公司年产10万吨颗粒硅项目",
              state: "进行中",
              totalInput: 5,
            },
            {
              label: "青海盐湖佛照蓝科锂业2万/年吨电池级碳酸锂项目",
              type: "children",
              address: "-",
              externalMan: 1,
              formalMan: 0,
              manager: "",
              onDuty: 1,
              position: [0.0, 0.0],
              projectCode: "17128",
              projectId: 305,
              projectName: "青海盐湖佛照蓝科锂业2万/年吨电池级碳酸锂项目",
              state: "进行中",
              totalInput: 1,
            },
            {
              label: "山东滨华新材料有限公司新能源化学品项目10万吨/年甲胺装置",
              type: "children",
              address: "山东省滨州市北海经济开发区临港化工产业园",
              externalMan: 0,
              formalMan: 1,
              manager: "",
              onDuty: 1,
              position: [117.870617, 37.997397],
              projectCode: "22072",
              projectId: 310,
              projectName:
                "山东滨华新材料有限公司新能源化学品项目10万吨/年甲胺装置",
              state: "进行中",
              totalInput: 1,
            },
            {
              label: "陕煤集团榆林化学有限公司180万吨/年乙二醇项目",
              type: "children",
              address: "陕西榆林榆神工业园区清水煤化工工业",
              externalMan: 7,
              formalMan: 0,
              manager: "",
              onDuty: 7,
              position: [111.066876, 39.251675],
              projectCode: "18078",
              projectId: 311,
              projectName: "陕煤集团榆林化学有限公司180万吨/年乙二醇项目",
              state: "进行中",
              totalInput: 7,
            },
            {
              label:
                "陕西龙华集团煤业科技发展有限公司煤炭分级分质清洁高效综合利用项目",
              type: "children",
              address: "陕西省榆林市神木市孙家岔镇燕家塔工业园",
              externalMan: 1,
              formalMan: 2,
              manager: "",
              onDuty: 3,
              position: [110.361378, 39.12927],
              projectCode: "22125",
              projectId: 312,
              projectName:
                "陕西龙华集团煤业科技发展有限公司煤炭分级分质清洁高效综合利用项目",
              state: "进行中",
              totalInput: 3,
            },
            {
              label: "兖矿新疆煤化工有限公司年产6万吨三聚氰胺项目",
              type: "children",
              address: "-",
              externalMan: 0,
              formalMan: 1,
              manager: "",
              onDuty: 1,
              position: [0.0, 0.0],
              projectCode: "20157",
              projectId: 321,
              projectName: "兖矿新疆煤化工有限公司年产6万吨三聚氰胺项目",
              state: "进行中",
              totalInput: 1,
            },
          ],
        },
        {
          id: 33,
          label: "西南大区",
          type: "parent",
          children: [
            {
              label: "弘元能源科技（包头）有限公司高纯晶硅（一期）项目",
              type: "children",
              address: "内蒙古自治区包头市固阳县金山工业园",
              externalMan: 5,
              formalMan: 7,
              manager: "",
              onDuty: 12,
              position: [110.048281, 40.979021],
              projectCode: "22011",
              projectId: 1,
              projectName: "弘元能源科技（包头）有限公司高纯晶硅（一期）项目",
              state: "进行中",
              totalInput: 12,
            },
            {
              label: "连云港圣奥化学科技有限公司聚合物添加剂项目（一期）",
              type: "children",
              address: "江苏省连云港市国家东中西区域合作示范区",
              externalMan: 4,
              formalMan: 2,
              manager: "",
              onDuty: 6,
              position: [119.522808, 34.620093],
              projectCode: "19089",
              projectId: 2,
              projectName: "连云港圣奥化学科技有限公司聚合物添加剂项目（一期）",
              state: "进行中",
              totalInput: 6,
            },
            {
              label: "公司本部",
              type: "children",
              address: "中国西安高新技术产业开发区唐延南路7号",
              externalMan: 0,
              formalMan: 0,
              manager: "",
              onDuty: 0,
              position: [108.889304, 34.1909],
              projectCode: "-",
              projectId: 298,
              projectName: "公司本部",
              state: "进行中",
              totalInput: 0,
            },
            {
              label: "江苏中能硅业科技发展有限公司高纯颗粒硅技改项目",
              type: "children",
              address: "-",
              externalMan: 3,
              formalMan: 0,
              manager: "",
              onDuty: 3,
              position: [0.0, 0.0],
              projectCode: "21125",
              projectId: 300,
              projectName: "江苏中能硅业科技发展有限公司高纯颗粒硅技改项目",
              state: "进行中",
              totalInput: 3,
            },
            {
              label: "同德科创材料有限公司PBAT新材料产业链一体化项目",
              type: "children",
              address: "忻州市原平经济技术开发区现代煤化工产业园",
              externalMan: 4,
              formalMan: 1,
              manager: "",
              onDuty: 5,
              position: [112.734174, 38.416663],
              projectCode: "21068",
              projectId: 313,
              projectName: "同德科创材料有限公司PBAT新材料产业链一体化项目",
              state: "进行中",
              totalInput: 5,
            },
          ],
        },
      ],
    });
  });
};

export const addTree = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/tree/add",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};

export const delTree = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/tree/delete",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};

export const changeTree = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/tree/update",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};

export const changeTreeBody = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/tree/move",
    data,
  });
  console.log(data);
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [],
    });
  });
};

export const getAllCom = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/construct/vendorMap/list",
    data,
  });
};

export const getTable = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/vendorMap/pageList",
    data,
  });
};

export const submitEditProjectData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/update",
    data,
  });
};

export const DelProjectData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/delete",
    data,
  });
};

export const submitAddProjectData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/create",
    data,
  });
};

export const getProjectMapAndData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/list",
    data,
  });
};

// 改
export const getPersonData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/pageList",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      total: 12,
      data: [
        {
          name: "安峰博",
          Rank: "讲好",
          state: 1, //在岗 (场)   0 离岗
          projects: 1,
          phone: 13396781596,
        },
        {
          name: "传冰冰",
          Rank: "讲好",
          state: 0,
          projects: 5,
          phone: 13396781596,
        },
        {
          name: "陈德武",
          Rank: "讲好",
          state: 1,
          projects: 15,
          phone: 13396781596,
        },
      ],
    });
  });
};

export const getContractData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/contract/pageList",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      total: 123,
      data: [
        {
          contractCode: "18229-HT-001",
          contractName: "讲好",
          vendor: "广东揭阳惠来县大南海国际石化工业区",
          building: "上海市曹安公路1855号10F 021-62263673",
          community: "上海和晟仪器科技有限公司",
          Assessment: "不错",
          lnglat: [121.361027, 31.253691],
        },
        {
          contractCode: "18229-HT-001",
          contractName: "讲好",
          vendor: "广东揭阳惠来县大南海国际石化工业区",
          building: "上海市曹安公路1855号10F 021-62263673",
          community: "上海和晟仪器科技有限公司",
          Assessment: "",
          lnglat: [121.361027, 31.253691],
        },
        {
          contractCode: "18229-HT-001",
          contractName: "讲好",
          vendor: "广东揭阳惠来县大南海国际石化工业区",
          building: "上海市曹安公路1855号10F 021-62263673",
          community: "上海和晟仪器科技有限公司",
          Assessment: "不错",
          lnglat: [121.361027, 31.253691],
        },
      ],
    });
  });
};

export const changeState = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/changeOnSite",
    data,
  });
};

export const getContractMapData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/contract/pageList",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          contractCode: "18229-HT-001",
          contractName: "讲好",
          vendor: "在岗 (场)",
          building: "上海市曹安公路1855号10F 021-62263673",
          community: "上海和晟仪器科技有限公司",

          lnglat: [121.361027, 31.253691],
        },
        {
          contractCode: "18229-HT-001",
          contractName: "讲好",
          vendor: "在岗 (场)",
          building: "上海市曹安公路1855号10F 021-62263673",
          community: "上海和晟仪器科技有限公司",

          lnglat: [121.361027, 31.253691],
        },
      ],
    });
  });
};

export const getRYFBData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/empTotal",
    data,
  });
  return new Promise((res) => {
    res({
      msg: "查询成功",
      total: 128,
      code: 200,
      data: [
        {
          projects: 1,
          icon: "/file.icon.default.png",
          phone: "18740421669",
          name: "白晨",
          Rank: "员工",
          state: 1,
          project: ["广东石化炼化一体化", "广东石化炼化一体化"],
          remaining: [0.3, 1],
        },
        {
          projects: 0,
          phone: "18702981296",
          name: "曹源",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 1,
          phone: "18629283600",
          name: "常少伟",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 0,
          phone: "17602935950",
          name: "陈鹏",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 0,
          phone: "15996451398",
          name: "成素琴",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 0,
          phone: "13991379107",
          name: "程卫国",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 0,
          phone: "13630255135",
          name: "崔超",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 1,
          phone: "18629496895",
          name: "代毅博",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "18229059720",
          name: "戴开鑫",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "18729513866",
          name: "淡旭晨",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "15291981863",
          name: "丁犁军",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "13759984397",
          name: "董国伟",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 0,
          phone: "15891252992",
          name: "董永聚",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 0,
          phone: "13679175826",
          name: "杜轩成",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 1,
          phone: "17792977192",
          name: "樊泽松",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "18690077057",
          name: "冯帅帅",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 0,
          phone: "18740409562",
          name: "高杰",
          Rank: "员工",
          state: 0,
        },
        {
          projects: 1,
          phone: "18829126833",
          name: "高晓南",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "\\",
          name: "郭晨",
          Rank: "员工",
          state: 1,
        },
        {
          projects: 1,
          phone: "13468881901",
          name: "郭甲",
          Rank: "员工",
          state: 1,
        },
      ],
    });
  });
};

export const getRYFBMapData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/list",
    data,
  });
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          address: "内蒙古自治区包头市九原区工业园区",

          position: [103.812983, 29.400629],
          projectCode: "22015",
          projectId: 3,
          projectName: "内蒙大全十万吨多晶硅数字化交付",
          personNum: 13,
        },
        {
          address: "广东揭阳惠来县大南海国际石化工业区",

          position: [116.175432, 22.948186],
          projectCode: "22015",
          projectId: 3,
          projectName: "广东石化炼化一体化项目",
          personNum: 23,
        },
      ],
    });
  });
};

export const getCJData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/vendorMap/pageList",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      total: 6544,
      code: 200,
      data: [
        {
          community: "上海和晟仪器科技有限公司",
          building: "上海市曹安公路1855号10F 021-62263673",
          id: "VDA00B0F",
          lnglat: [121.361027, 31.253691],
          HistoryArr: [
            {
              projectNum: "xxx1",
              contractNum: "aaa",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx1",
              contractNum: "bbb",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx1",
              contractNum: "ccc",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx2",
              contractNum: "aaa11",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx2",
              contractNum: "aaa11",
              Assessment: "WOSHIREN",
            },
          ],
        },
        {
          community: "优必胜智能科技（西安）有限公司",
          building: "陕西省西安市长安区北航科技园1号楼903室",
          id: "VDA00B0D",
          lnglat: [108.978086, 34.161218],
          HistoryArr: [
            {
              projectNum: "xxx1",
              contractNum: "aaa",
              Assessment: "",
            },
            {
              projectNum: "xxx1",
              contractNum: "bbb",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx1",
              contractNum: "ccc",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx2",
              contractNum: "aaa11",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx2",
              contractNum: "aaa11",
              Assessment: "WOSHIREN",
            },
          ],
        },
        {
          community: "萍乡中天化工填料有限公司",
          building: "江西省萍乡市安源新区工业园",
          id: "VDA00B0C",
          lnglat: [113.920998, 27.634882],
          HistoryArr: [
            {
              projectNum: "xxx1",
              contractNum: "aaa",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx1",
              contractNum: "bbb",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx1",
              contractNum: "ccc",
              Assessment: "",
            },
            {
              projectNum: "xxx2",
              contractNum: "aaa11",
              Assessment: "WOSHIREN",
            },
            {
              projectNum: "xxx2",
              contractNum: "aaa11",
              Assessment: "WOSHIREN",
            },
          ],
        },
      ],
    });
  });
};

export const getCJBottomData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/vendorMap/queryContracts",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",

      code: 200,
      data: [
        {
          projectNum: "xxx1",
          contractNum: "aaa",
          number: "",
          desc:'',
        },
        {
          projectNum: "xxx1",
          contractNum: "bbb",
          number: "WOSHIREN",
          desc:'',
        },
     
      ],
    });
  });
};

export const EchartsDataGYS = (data) => {
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      total: 123,
      data: [
        {
          projectsName: "广东石化炼化一体化项目",
          vendorNum: 13,
        },
        {
          projectsName: "内蒙大全十万吨多晶硅数字化交付",
          vendorNum: 132,
        },
        {
          projectsName: "永祥能源科技晶硅数字化交付项目",
          vendorNum: 233,
        },
      ],
    });
  });
};

export const applySubmit = (data) => {
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          applicant: "张三",
          applyTime: "2022-12-13",
          projectName: "内蒙大全十万吨多晶硅数字化交付",
        },
        {
          applicant: "张三",
          applyTime: "2023-02-13",
          projectName: "广东石化炼化一体化项目",
        },
      ],
    });
  });
};

export const applyPersonData = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/approve/chooseAppUser",
    data,
  });
  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        {
          id: "addcs",
          name: "李明",
          num: "20221213",
          project: ["内蒙大全十万吨多晶硅数字化交付", "广东石化炼化一体化"],
          positionJob: "项目经理",
        },
        {
          id: "addcs23",
          name: "李四",
          num: "20221213",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          positionJob: "普通组员",
        },
        {
          id: "add11cs23",
          name: "李勇",
          num: "2021321213",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          positionJob: "项目经理",
        },
        {
          id: "ad133d11cs23",
          name: "王五五",
          num: "244221213",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          positionJob: "普通组员",
        },
      ],
    });
  });
};

export const applyProcess = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/listGroupUser",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      total: 128,
      code: 200,
      data: [
        {
          name: "白晨",
          project: [
            {
              color: 1,
              value:
                "万华化学（福建）异氰酸酯有限公司40万吨/年MDI项目低温乙烯罐项目",
            },
          ],
          id: 63,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
          arrivalTime: [
            {
              color: 1,
              value: "2022-12-13 00:00:00",
            },
          ],
          estimatedArrivalTime: [
            {
              color: 1,
              value: "2022-12-13 00:00:00",
            },
          ],
        },
        {
          name: "曹源",
          project: [],
          id: 62,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "常少伟",
          project: [
            {
              color: 1,
              value: "重庆气凝胶项目",
            },
          ],
          id: 161,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "陈鹏",
          project: [],
          id: 65,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "成素琴",
          project: [],
          id: 154,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "程卫国",
          project: [],
          id: 64,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "崔超",
          project: [],
          id: 66,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "代毅博",
          project: [
            {
              color: 1,
              value: "同德科创材料有限公司PBAT新材料产业链一体化项目",
            },
          ],
          id: 168,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "戴开鑫",
          project: [
            {
              color: 1,
              value: "弘元能源科技（包头）有限公司高纯晶硅（一期）项目",
            },
          ],
          id: 67,
          state: ["在现场"],
          type: "正式",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "淡旭晨",
          project: [
            {
              color: 1,
              value: "内蒙古三维新材料有限公司BDO一体化项目",
            },
          ],
          id: 68,
          state: ["在现场"],
          type: "正式",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "丁犁军",
          project: [
            {
              color: 1,
              value: "连云港圣奥化学科技有限公司聚合物添加剂项目（一期）",
            },
          ],
          id: 69,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "董国伟",
          project: [
            {
              color: 1,
              value: "山东滨华新材料有限公司新能源化学品项目10万吨/年甲胺装置",
            },
          ],
          id: 70,
          state: ["在现场"],
          type: "正式",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "董永聚",
          project: [],
          id: 71,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "杜轩成",
          project: [],
          id: 72,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "樊泽松",
          project: [
            {
              color: 1,
              value:
                "陕西龙华集团煤业科技发展有限公司煤炭分级分质清洁高效综合利用项目",
            },
          ],
          id: 73,
          state: ["在现场"],
          type: "正式",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "冯帅帅",
          project: [
            {
              color: 1,
              value: "弘元能源科技（包头）有限公司高纯晶硅（一期）项目",
            },
          ],
          id: 135,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "高杰",
          project: [],
          id: 74,
          state: [],
          type: "正式",
          remaining: [],
        },
        {
          name: "高晓南",
          project: [
            {
              color: 1,
              value: "陕煤集团榆林化学有限公司180万吨/年乙二醇项目",
            },
          ],
          id: 155,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "郭晨",
          project: [
            {
              color: 1,
              value: "连云港圣奥化学科技有限公司聚合物添加剂项目（一期）",
            },
          ],
          id: 171,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
        {
          name: "郭甲",
          project: [
            {
              color: 1,
              value: "内蒙古鑫元硅材料科技有限公司年产10万吨颗粒硅项目",
            },
          ],
          id: 134,
          state: ["在现场"],
          type: "外聘",
          remaining: [
            {
              color: 1,
              value: 1.0,
            },
          ],
        },
      ],
    });
  });
};





export const applyPersonDBFN = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/approve/queryApprove",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      type: 2, // 0 采购经理视角   1 组长视角  2 主任视角
      data: [
        {
          id: "add11cs23",
          applyName: "李勇",
          applyTime: "2022-12-13 00:13",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          applyPerson: "张武",
          jobRequire: 0, //0 到现场    1 参与项目
          applyLeaderState: 0, // 0 无操作  1 同意   2 驳回
          applyLeaderMsg: "",
          applyDirectorState: 0, // 0 无操作  1 同意   2 驳回
          applyDirectorMsg: "",
        },
        {
          id: "add11cs23",
          applyName: "李勇",
          applyTime: "2022-12-13 00:13",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          applyPerson: "王旭",
          jobRequire: 1, //0 到现场    1 参与项目
          applyLeaderState: 1, // 0 无操作  1 同意   2 驳回
          applyLeaderMsg: "",
          applyDirectorState: 0, // 0 无操作  1 同意   2 驳回
          applyDirectorMsg: "",
        },
        {
          id: "add11cs23",
          applyName: "李勇",
          applyTime: "2022-12-13 00:13",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          applyPerson: "刚强",
          jobRequire: 1, //0 到现场    1 参与项目
          operate: 2, // 0 无操作  1 同意   2 驳回
          applyLeaderState: 2, // 0 无操作  1 同意   2 驳回
          applyLeaderMsg: "不通过",
          applyDirectorState: 0, // 0 无操作  1 同意   2 驳回
          applyDirectorMsg: "",
        },
        {
          id: "add11cs23",
          applyName: "李勇",
          applyTime: "2022-12-13 00:13",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          applyPerson: "刚强2",
          jobRequire: 1, //0 到现场    1 参与项目
          operate: 2, // 0 无操作  1 同意   2 驳回
          applyLeaderState: 1, // 0 无操作  1 同意   2 驳回
          applyLeaderMsg: "不通过",
          applyDirectorState: 1, // 0 无操作  1 同意   2 驳回
          applyDirectorMsg: "",
        },

        {
          id: "add11cs23",
          applyName: "李勇",
          applyTime: "2022-12-13 00:13",
          project: ["内蒙大全十万吨多晶硅数字化交付"],
          applyPerson: "刚强2",
          jobRequire: 1, //0 到现场    1 参与项目
          operate: 2, // 0 无操作  1 同意   2 驳回
          applyLeaderState: 1, // 0 无操作  1 同意   2 驳回
          applyLeaderMsg: "",
          applyDirectorState: 2, // 0 无操作  1 同意   2 驳回
          applyDirectorMsg: "主任不通过",
        },
      ],
    });
  });
};

export const applyPersonTG = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/approve/doApprove",
    data,
  });
};

export const getUserRole = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/empInfo",
    data,
  });
};

export const EchartsDataREFB = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/emp/empInProjChart",
    data,
  });
  return new Promise({
    msg: "查询成功",
    code: 200,
    data: [
      {
        name: "弘元能源科技（包头）有限公司高纯晶硅（一期）项目",
        id: 1,
        value: 12,
      },
      {
        name: "连云港圣奥化学科技有限公司聚合物添加剂项目（一期）",
        id: 2,
        value: 6,
      },
      {
        name: "21811项目",
        id: 297,
        value: 1,
      },
      {
        name: "广西华谊项目",
        id: 299,
        value: 3,
      },
      {
        name: "江苏中能硅业科技发展有限公司高纯颗粒硅技改项目",
        id: 300,
        value: 3,
      },
      {
        name: "乐山协鑫新能源科技有限公司年产10万吨颗粒硅项目",
        id: 301,
        value: 4,
      },
      {
        name: "内蒙古三维新材料有限公司BDO一体化项目",
        id: 302,
        value: 5,
      },
      {
        name: "内蒙古鑫元硅材料科技有限公司年产10万吨颗粒硅项目",
        id: 303,
        value: 5,
      },
      {
        name: "青海南玻",
        id: 304,
        value: 1,
      },
      {
        name: "青海盐湖佛照蓝科锂业2万/年吨电池级碳酸锂项目",
        id: 305,
        value: 1,
      },
      {
        name: "山东滨华新材料有限公司新能源化学品项目10万吨/年甲胺装置",
        id: 310,
        value: 1,
      },
      {
        name: "陕煤集团榆林化学有限公司180万吨/年乙二醇项目",
        id: 311,
        value: 7,
      },
      {
        name: "陕西龙华集团煤业科技发展有限公司煤炭分级分质清洁高效综合利用项目",
        id: 312,
        value: 3,
      },
      {
        name: "同德科创材料有限公司PBAT新材料产业链一体化项目",
        id: 313,
        value: 5,
      },
      {
        name: "万华PDH",
        id: 314,
        value: 1,
      },
      {
        name: "万华化学（福建）异氰酸酯有限公司40万吨/年MDI项目低温乙烯罐项目",
        id: 316,
        value: 2,
      },
      {
        name: "万华化学（四川）有限公司眉山NMP项目",
        id: 317,
        value: 1,
      },
      {
        name: "新华半导体项目",
        id: 318,
        value: 2,
      },
      {
        name: "新疆宣东35万吨/年轻质煤焦油深加工项目（二期）EPC总承包",
        id: 319,
        value: 4,
      },
      {
        name: "新疆中泰新材料股份有限公司资源化综合利用制甲醇升级示范项目净化装置",
        id: 320,
        value: 1,
      },
      {
        name: "兖矿新疆煤化工有限公司年产6万吨三聚氰胺项目",
        id: 321,
        value: 1,
      },
      {
        name: "云南氟化氢",
        id: 322,
        value: 3,
      },
      {
        name: "重庆气凝胶项目",
        id: 323,
        value: 3,
      },
    ],
  });
};

export const getSubmitComment = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/contract/submitComment",
    data,
  });
};

export const EchartsDataXMFB = (data) => {
  return service({
    method: "POST",
    url: "/apt/construct/projMap/projChart",
    data,
  });

  return new Promise((res) => {
    res({
      msg: "查询成功",
      code: 200,
      data: [
        { value: 13, name: "西北大区" },
        { value: 24, name: "东北大区" },
        { value: 11, name: "华南大区" },
        { value: 1, name: "其他" },
      ],
    });
  });
};

export const checkAllDataPerson = (data) => {
  console.log(data)
  return service({
    method: "POST",
    url: "/apt/construct/emp/empTotalInfo",
    data,
  });
  return new Promise((res) => {
    res({
      msg: "查询成功",
      total: 128,
      code: 200,
      data: [
        {
          personCode:1,
          arrivalTime: '2022-12-13',
          name: "白晨",
          workCode:'1234',
          title:'高工',
          id: 63,
          state: '在现场',
          type: "外聘",
          remaining: '非常饱满',
          manager:'1',
          procure:'',
          quotation:'',
          logistics:'',
          expediting:'',
          plan:'部门管理和多项目协调',
          address:'本部',
          projectNum:2,
          ///
          project: '有限公司40万吨12/年MDI项目低温乙烯罐项目',
       
     
          projectCode:'xxxas21',
          phase:'总包',
          leader:'腱反',
          specialities:'仪表',
          role:'项目经理',
          ///

        },
        {
          personCode:1,
          arrivalTime: '2022-12-13',
          name: "白晨",
          title:'高工',
          workCode:'1234',
          id: 63,
          state: '在现场',
          type: "外聘",
          remaining: '非常饱满',
          manager:'1',
          procure:'',
          quotation:'',
          logistics:'',
          expediting:'',
          plan:'部门管理和多项目协调',
          address:'本部',
          projectNum:2,
          ///
          project: '有限公司40万吨123/年MDI项目低温乙烯罐项目',
   
          projectCode:'xxxas21',
          phase:'总包',
          leader:'腱反',
          specialities:'仪表',
          role:'项目经理',
          ///

        },
        {
          personCode:1,
          arrivalTime: '2022-12-13',
          name: "白晨",
          title:'高工',
          workCode:'1234',
          id: 63,
          state: '在现场',
          type: "外聘",
          remaining: '非常饱满',
          manager:'1',
          procure:'',
          quotation:'',
          logistics:'',
          expediting:'',
          plan:'部门管理和多项目协调',
          address:'本部',
          projectNum:2,
          ///
          project: '有限公司40万吨12323/年MDI项目低温乙烯罐项目',
   
          projectCode:'xxxas21',
          phase:'总包',
          leader:'腱反',
          specialities:'仪表',
          role:'项目经理',
          ///

        },
        {
          personCode:2,
          arrivalTime: '2022-12-13',
          name: "21白晨",
          title:'高工',
          workCode:'1234',
          id: 63,
          state: '在现场',
          type: "外聘",
          remaining: '非常饱满',
          manager:'1',
          procure:'',
          quotation:'',
          logistics:'',
          expediting:'',
          plan:'部门管理和多项目协调',
          address:'本部',
          projectNum:2,
          ///
          project: '有限公司40万吨/年MDI项目低温乙烯罐项目',
   
          projectCode:'xxxas21',
          phase:'总包',
          leader:'腱反',
          specialities:'仪表',
          role:'项目经理',
          ///

        },

      ],
    });
  });
};
